package management;

import processing.core.PApplet;

/**
 * Singleton class to keep track of Application handles and data, such as the PApplet.
 * 
 * @author Dylan James
 *
 */
public class ApplicationManager {
	private static ApplicationManager instance;
	
	private PApplet pApplet;
	
	/**
	 * @return An instance of the application manager.
	 */
	public static ApplicationManager getApplicationManager()
	{
		if (instance == null)
		{
			instance = new ApplicationManager();
		}
		
		return instance;
	}
	
	private ApplicationManager()
	{
	}
	
	/**
	 * Sets the applications PApplet to the given PApplet
	 * @param pApplet
	 */
	public void setPApplet(PApplet pApplet)
	{
		this.pApplet = pApplet;
	}
	
	/**
	 * @return This applications PApplet
	 */
	public PApplet getPApplet()
	{
		return this.pApplet;
	}
}
